package com.haojiu.service;

import com.github.pagehelper.PageHelper;
import com.haojiu.mapper.TypeInfoMapper;
import com.haojiu.pojo.TypeInfo;

import java.util.List;

/**
 * @author:我叫浩九
 * @date：2021/8/27 15:43
 * create in RuGao JiangSu
 */
public class TypeInfoServiceImpl implements TypeInfoService{
   private TypeInfoMapper typeInfoMapper;

   public void setTypeInfoMapper(TypeInfoMapper typeInfoMapper){
       this.typeInfoMapper=typeInfoMapper;
   }
    @Override
    public List<TypeInfo> getTypeInfo(String typeName) {
       return typeInfoMapper.getTypeInfo(typeName);
    }

    @Override
    public TypeInfo getTypeInfo2(int id) {
        return typeInfoMapper.getTypeInfo2(id);
    }

    @Override
    public List<TypeInfo> getAllTypeInfo(int page,int size) {
        PageHelper.startPage(page,size);
       return typeInfoMapper.getAllTypeInfo();
    }

    @Override
    public List<TypeInfo> getAllTypeInfo() {
        return typeInfoMapper.getAllTypeInfo();
    }

    @Override
    public int updateTypeInfo(TypeInfo typeInfo) {
       return typeInfoMapper.updateTypeInfo(typeInfo);
    }

    @Override
    public int delTypeInfo(int id) {
        return typeInfoMapper.delTypeInfo(id);
    }

    @Override
    public int addTypeInfo(TypeInfo typeInfo) {
       return typeInfoMapper.addTypeInfo(typeInfo);
    }
}
